import request from '@/utils/request'

export function getSurvey(data) {
    return request({
        url: '/survey/',
        method: 'get',
    })
}

export function addSurvey(data) {
    return request({
        url: '/survey/',
        method: 'post',
        data
    })
}

export function updateSurvey(id, data) {
    return request({
        url: `/survey/${id}/`,
        method: 'patch',
        data
    })
}

export function getSurveyById(id) {
    return request({
        url: `/survey/${id}/`,
        method: 'get',
    })
}

export function submitSurvey(id, data) {
    return request({
        url: `/survey/${id}/submit/`,
        method: 'post',
        data
    })
}

export function getSubmitSurvey(id) {
    return request({
        url: `/survey/${id}/get_submit/`,
        method: 'get',
    })
}

export function deleteSurvey(id) {
    return request({
        url: `/survey/${id}/`,
        method: 'delete',
    })
}

export function delSurveySubmit(id) {
    return request({
        url: `/submit_survey/${id}/`,
        method: 'DELETE',
    })
}
